﻿using System;

namespace UniRx
{
	// Token: 0x020003B1 RID: 945
	public struct CancellationToken
	{
		// Token: 0x06001353 RID: 4947 RVA: 0x0005876F File Offset: 0x00056B6F
		public CancellationToken(ICancelable source)
		{
			this.source = source;
		}

		// Token: 0x1700014E RID: 334
		// (get) Token: 0x06001354 RID: 4948 RVA: 0x00058778 File Offset: 0x00056B78
		public bool IsCancellationRequested
		{
			get
			{
				return this.source != null && this.source.IsDisposed;
			}
		}

		// Token: 0x06001355 RID: 4949 RVA: 0x00058796 File Offset: 0x00056B96
		public void ThrowIfCancellationRequested()
		{
			if (this.IsCancellationRequested)
			{
				throw new OperationCanceledException();
			}
		}

		// Token: 0x04000B69 RID: 2921
		private readonly ICancelable source;

		// Token: 0x04000B6A RID: 2922
		public static readonly CancellationToken Empty = new CancellationToken(null);

		// Token: 0x04000B6B RID: 2923
		public static readonly CancellationToken None = new CancellationToken(null);
	}
}
